package com.zcc.blog.mapper;

import com.zcc.blog.entity.TbCategoryBlog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zcc
 * @since 2022-09-11
 */
@Mapper
public interface TbCategoryBlogMapper extends BaseMapper<TbCategoryBlog> {

    /**
     * 通过分类id查找所有博客id
     * @param categoryId
     * @return
     */
    public List<TbCategoryBlog> findAllByCategoryId(Long categoryId);

    /**
     * 通过分类id查找所有博客id
     * @param blogId
     * @return
     */
    public List<TbCategoryBlog> findAllByBlogId(Long blogId);

    /**
     * 删除或者恢复分类
     * @param status 1 删除 0 恢复
     * @param id
     * @return
     */
    public boolean changeStatus(Integer status, Long id);

}
